<template>
    <div>
        测试Vuex<br/>
        {{myCount}}<br/>
        <button @click="$store.commit('add',2)">+2</button>

        <button @click="$store.commit('substrict',2)">-2</button>
    </div>
</template>

<script>
export default {
    computed:{
        myCount(){
            return this.$store.state.count
        }
    }
}
</script>